# -*- coding: utf8-*-
"""
接口所有的路由都在这里配置
"""
__author__ = 'Chenshuchuan'
from . import restful_api as api
from app.api.apis import api_user, api_dashboard

"""
dashboard
"""

"""
auth ,login, users, wx, openid
"""
# 登陆验证,获取token
api.add_resource(api_user.AuthLogin, '/auth/login', endpoint='AuthLogin')

# 微信用户验证，获取token, 此方式为客户端取openid
api.add_resource(api_user.AuthLoginWx, '/auth/login/wx', endpoint='AuthLoginWx')

# 验证token是否正确
api.add_resource(api_user.AuthToken, '/auth/token', endpoint='AuthToken')

# 根据refresh_token从新获取token
api.add_resource(api_user.RefreshToken, '/auth/token/refresh', endpoint='RefreshToken')

# 用户列表
api.add_resource(api_user.ApiUser, '/users', endpoint='ApiUser')

# 添加用户
api.add_resource(api_user.AddUser, '/users/new', endpoint='AddUser')

# 编辑用户信息, 删除用户
api.add_resource(api_user.EditUser, '/users/<int:id>', endpoint='EditUser')

# 更新用户权限
api.add_resource(api_user.UpdateRole, '/users/role/update', endpoint='UpdateRole')

# 批量导入用户
api.add_resource(api_user.BatchUser, '/users/batch/new', endpoint='BatchUser')

# 微信用户验证，获取token,此方式为服务端取openid
api.add_resource(api_user.AuthWx, '/auth/wx', endpoint='AuthWx')

# 获取手机验证码
api.add_resource(api_user.AuthPhone, '/auth/phone/code', endpoint='AuthPhone')

# 绑定手机号
api.add_resource(api_user.BindPhone, '/auth/phone/binding', endpoint='BindPhone')

# 更换绑定手机号
api.add_resource(api_user.UpdateBindPhone, '/auth/phone/binding/update', endpoint='UpdateBindPhone')
